/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package protocol;

/**
 *
 * @author Alexx
 */
import appClient.ConnectClient;
import engine.Singleton;
import java.text.ParseException;
import java.util.List;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;

//import org.apache.log4j.Logger;

public class ClientProtocol {
  ConnectClient connectClient;
 // private static final Logger log = Logger.getLogger(Protocol.class);
  
  public ClientProtocol ()
  {
    
  }
 
  public ClientProtocol (ConnectClient connectClient)
  {
    this.connectClient = connectClient;
  }
  
    public String getClient(String str) throws org.json.simple.parser.ParseException
   {
       String type;
       String rety = str;
       
       
       JsonSerializer json = new JsonSerializer();
       json.startGet(str);
       
       type = json.getString("Type");
       
       if (type.equals("GetList"))
       {
        // String name = json.getString("Name");
         //log.debug(name);
         rety = "GetList";
         try {
          // control.execute(rety, name, null, null, null);
         } catch (Exception e)
        {
          //  log.info("test" + e);
        }
       }
       
       if (type.equals("Info"))
       {
        // String name = json.getString("Name");
         //log.debug(name);
         rety = "Info";
         try {
          // control.execute(rety, name, null, null, null);
         } catch (Exception e)
        {
          //  log.info("test" + e);
        }
       }
       
       return rety;
   }
  
}
